<?php
	$MaBai = $_GET['id'];
	$bs = new baivietbs();
	$bs->MaBaiViet = $MaBai;
	$kq = $bs->LayDanhSach();
	$TrangThaiXuatBan = $kq[0]["XuatBan"];
	if($TrangThaiXuatBan == 0)
	{
		$bs->XuatBan = 1;
	}
	else
	{
		$bs->XuatBan = 0;
	}
	$bs->CapNhatXuatBan();
	session_start();
	$nhatky = new nhatkybs();
	$nhatky->TenSuKien = "Thay đổi xuất bản cho bài viết";
	$nhatky->MaNguoiDung = $_SESSION["MaND"];
	date_default_timezone_set('Asia/Ho_Chi_Minh');
	$nhatky->ThoiGian = date("Y-m-d H:m:s", time());
	$nhatky->Them();
	header("Location:index.php?do=baiviet");
?>